<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改小程序用户')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-member-edit" th:object="${member}">
            <input name="id" th:field="*{id}" type="hidden">
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">角色：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="radio-box" th:each="dict : ${@dict.getType('member_role')}">-->
<!--                        <input type="radio" th:id="${'role_' + dict.dictCode}" name="role" th:value="${dict.dictValue}" th:field="*{role}">-->
<!--                        <label th:for="${'role_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">手机号：</label>
                <div class="col-sm-8">
                    <input name="mobile" th:field="*{mobile}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">微信号：</label>
                <div class="col-sm-8">
                    <input name="wechat" th:field="*{wechat}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">性别：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('member_sex')}">
                        <input type="radio" th:id="${'sex_' + dict.dictCode}" name="sex" th:value="${dict.dictValue}" th:field="*{sex}">
                        <label th:for="${'sex_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">用户名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否是会员：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('memeber_is_vip')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{isVip}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">会员到期时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="vipEndTime" class="form-control" placeholder="yyyy-MM-dd"
                               type="text" th:value="${#dates.format(member.vipEndTime, 'yyyy-MM-dd')}">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">账户状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('member_status')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">发新闻：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('member_news_close')}">
                        <input type="radio" th:id="${'newsClose_' + dict.dictCode}" name="newsClose" th:value="${dict.dictValue}" th:field="*{newsClose}">
                        <label th:for="${'newsClose_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">行情官：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('member_quotation')}">
                        <input type="radio" th:id="${'quotation' + dict.dictCode}" name="quotation" th:value="${dict.dictValue}" th:field="*{quotation}">
                        <label th:for="${'quotation' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "system/member";
        $("#form-member-edit").validate({
            focusCleanup: true
        });

        $("input[name='vipEndTime']").datetimepicker({
            format: "yyyy-mm-dd",
            autoclose: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-member-edit').serialize());
            }
        }
    </script>
</body>
</html>
